<template>
  <div id="app">
    <v-header :seller="seller"></v-header>
    <div class="tab">
      <router-link to="/seller" class="tab-item">商家</router-link>
      <router-link to="/goods" class="tab-item">商品</router-link>
      <router-link to="/ratings" class="tab-item">评论</router-link>
    </div>
    <router-view :seller="seller">
      <div>woshi neir ef weg </div>
    </router-view>
  </div>
</template>

<script type="text/ecmascript-6">
import header from './components/header/header.vue'
const Err_ok = 0;
  export default{
    data() {
      return {
        seller: {}
      }
    },
    created() {
      this.$http.get('/api/seller').then((res)  =>{
          res = res.body;
//        console.log(res)
        if(res.errno === Err_ok){
          this.seller = res.data;
//          console.log(this.seller)
        }
      },(req) =>{

      })
    },
    components:{
      'v-header':header
    }
  }
</script>

<style>
.tab{
  width: 100%;
  display: flex;
  height:40px;
  line-height:40px;
}
  .tab .tab-item{
    flex:1;
    font-size:16px;
    text-align: center;
    color:rgb(77,85,93);
    border-bottom:1px solid #eaeaea;
  }
.tab .tab-item:hover.active{
  color:rgb(240,20,20);
  }
</style>
